package phone.qyg.com.qyg.adapter;

import android.content.Context;

import com.app.adapter.recycler.CommonAdapter;
import com.app.adapter.recycler.base.ViewHolder;
import com.app.utils.OptionImageUtils;

import java.util.List;

import phone.qyg.com.qyg.R;
import phone.qyg.com.qyg.model.Venues;

public class VenueAdapter extends CommonAdapter<Venues> {
    public VenueAdapter(Context context, List<Venues> datas) {
        super(context,R.layout.item_venue_two,datas);
    }
//    public VenueAdapter(Context context, List<String> datas) {
//        super(context, datas);
//        addItemViewDelegate(new VenueItemAdapter());
//    }

    @Override
    protected void convert(ViewHolder holder, Venues venues, int position) {
        holder.setImage(R.id.item_img,venues.fixImgUrl, OptionImageUtils.getRectRatioAct());
        holder.setText(R.id.item_title,venues.title);
        holder.setText(R.id.item_click,venues.click_count+"");
        holder.setText(R.id.item_time,venues.audit_date);
        holder.setText(R.id.item_address,venues.address);
    }

//    public class VenueItemAdapter implements ItemViewDelegate<String> {
//
//        @Override
//        public int getItemViewLayoutId() {
//            return R.layout.item_venue_two;
//        }
//
//        @Override
//        public boolean isForViewType(String item, int position) {
//            return false;
//        }
//
//        @Override
//        public void convert(ViewHolder holder, String o, int position) {
//
//        }
//    }
}
